<%-- 
    Document   : usuario_nuevo
    Created on : 2/07/2013, 12:56:44 AM
    Author     : angel
--%>
<%@page import="ConexionBD.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
           <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="recursos/style.css" rel="stylesheet" type="text/css" />
        <link  href="recursos/css/humanity/jquery-ui-1.10.2.custom.css" rel="stylesheet">
        <script src="recursos/js/jquery1-9.js"></script>
        <script src="recursos/js/jquery-ui-1.10.2.custom.js"></script>
        <script type="text/javascript" src="recursos/js/jquery.fancybox.js"></script>
        <link rel="stylesheet" type="text/css" href="recursos/css/jquery.fancybox.css" media="screen" />

        <title>JSP Page</title>
               <script type="text/javascript">
 
  function enviar() {  


	
	function AbrirAlerta(msg) {
                $.fancybox('<div class="padding_fancy"><div id="fancy_msg" class="font-dinB"><strong>'+msg+'</strong></div>', {
                minWidth: 200,
                minHeight: 100,
                maxWidth: 200,
                maxHeight: 100,
                autoSize: false
            });
        }
  }
</script>

    </head>
    <body>
        <%
      String nombre=request.getParameter("nombre");
      String apellido = request.getParameter("apellido");
      String usuario = request.getParameter("usuario");
      String dpi = request.getParameter("dpi");
      String pass = request.getParameter("pass");
      String correo = request.getParameter("correo");
      int rol = Integer.parseInt(request.getParameter("rol"));
     Conexion c1= new Conexion();
       c1.Conectar();
        if(c1.getEmail(correo)){
            if(c1.getUser(usuario)){
             c1.insertar_usuarios(nombre, apellido, usuario, correo, dpi, pass, rol) ;
             response.sendRedirect("home.jsp");
                          }
            else{
                out.print("Username ya ingresado");
                          }
            
                         }else{
            out.print("Email ya ingresado");
        }
       
        %>
    </body>
</html>
